package com.richinfo.buddy.oauthserver.controller;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.richinfo.buddy.oauthserver.model.entity.MyUserEntity;
import com.richinfo.buddy.oauthserver.service.UserService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

/**
* Created by WangXJ
* 2019-05-15 17:30
*/
@RestController
@Api(value = "UserController", tags = "用户登录相关操作", description = "用户登录相关操作")
public class UserController {
	
	@Resource
	private UserService userService;
	
    @ApiOperation(value = "登录", notes = "登录")
    @RequestMapping(path = "login", method = RequestMethod.POST)
    public MyUserEntity login4Swagger(@ApiParam("登录名") @RequestParam String username,
                                            @ApiParam("密码") @RequestParam String password,
                                            @ApiParam("验证码") @RequestParam String verifyCode,
                                            @ApiParam("是否记住我") @RequestParam(required = false, defaultValue = "false") boolean rememberMe) {
        return null;
    }

	@GetMapping("/test")
	public MyUserEntity test() {
		MyUserEntity user = userService.findById(24);
		
		return user;
	}
}
